﻿/*=========================================================================
 * AUTH: Vincent Breton
 * DESC: Wall Avoidance Steering Behavior
 *=========================================================================*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;   //   for Texture2D
using Microsoft.Xna.Framework;  //  for Vector2
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;


namespace RisingThreat
{
    class WallAvoidance: Seek
    {
        
        public bool wallOn;
      

        public WallAvoidance()
        {
            
            wallOn = false;
            
        }
        
        public  Steering getSteering(Steering s)
        {
            steer=s;

            if (wallOn == true)
            {
                //has arrived at target: set target to fake target and Wander
                if ((target - steer.position).Length() < 1.0f)
                {
                    wallOn = false;
                }
                else 
                {
                    wallOn = true;
                    WallAvoidanceHelper();
                }
            }
            return steer;
        }

        public void WallAvoidanceHelper()
        {
            
            seekHelper();
        }

       /* public void SetMultiplier()
        {
            if (contact.penetrationDepth < 1.0f)
            {
                multiplier = 1.0f;
            }
            else if (contact.penetrationDepth > 1.0f && contact.penetrationDepth < 2.5f)
                multiplier = 1.5f;
            else
                multiplier = 2.0f;
        }
        */
    }
}
